from datetime import timedelta
# from redis import StrictRedis
from redis import StrictRedis
import os

class Configs():
    print("配置文件加载成功")
    #调试信息
    DEBUG = True

    SECRET_KEY = os.urandom(24)

    #数据库配置信息
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost:3306/aotlook'
    SQLALCHEMY_TRACK_MODIFICATIONS = False


    #redis配置信息
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379

    #session配置信息
    SESSION_TYPE = 'redis' #设置session存储类型
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT) #指定session存储的Redis的服务器
    SESSION_USE_SIGNER = True #设置签名存储
    PERMANENT_SESSION_LIFETIME = timedelta(days=1) #设置session有效期

    #ckeditor配置
    CKEDITOR_FILE_UPLOADER = 'admin.upload'
    CKEDITOR_ENABLE_CSRF = True
#测试环境
class test(Configs):
    pass
config_dict = {
    'test':test,
}